package com.hzw.saas.service.rss.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzw.saas.service.rss.model.JournalCatalogUser;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


/**
 * <p>
 * 期刊站点 Mapper 接口
 * </p>
 *
 * @author sonam
 * @since 2021-06-30
 */
@Mapper
public interface JournalCatalogUserMapper extends BaseMapper<JournalCatalogUser> {
    @Delete("<script> delete from tb_journal_catalog_user where catalog_id in <foreach item=\"catalogId\" collection=\"catalogIds\"  open=\"(\" separator=\",\" close=\")\"> #{catalogId} </foreach> </script>")
    int deleteByCatalogIdsFromSql(@Param("catalogIds") List<String> catalogIds);

    @Delete("<script> delete from tb_journal_catalog_user where user_id = #{userId}</script>")
    void deleteByUserId(@Param("userId") String userId);

    @Delete("<script> delete from tb_journal_catalog_user where pid = #{id}</script>")
    void deleteById(@Param("id") String id);

    @Delete("<script> delete from tb_journal_catalog_user where parent_id = #{parentId}</script>")
    void deleteByParentId(@Param("parentId") String parentId);
}
